﻿@using MyResources = OutSourceingServices.Resources.Resources

<script type="text/javascript">
    function submit(fr, lag) {
        var form = document.getElementById(fr);
        form.onsubmit();
    }
</script>
<div>
    <form id="frEN" method="post" action="/Home/ChangeLanguage" style="float:right;" class="language">
        <img onclick="submit('frEN')" src="\Images\United-Kingdom-flag-icon.png" alt="English"  class="item"/>
        <input name="id" type="hidden" value="en-US" />
        <input id="hdENAction" name="actionName" type="hidden" />
        <input id="hdENController" name="controllerName" type="hidden" />
    </form>


    <form id="frVN" method="post" action="/Home/ChangeLanguage" class="language">        
        <img onclick="submit('frVN')" src="\Images\Vietnam-Flag-icon.png" alt="Viet Nam" class="item"/>
        <input name="id" type="hidden" value="vi-VN" />
        <input id="hdVNAction" name="actionName" type="hidden" />
        <input id="hdVNController" name="controllerName" type="hidden" />
    </form>

    
    <div class="clear"></div>
</div>


<script type="text/javascript">
    var url = window.location.href.toString().split(window.location.host)[1];
    var sliptUrl = url.split("/");
    var action, controller;

    controller = sliptUrl[1];
    if (sliptUrl.length == 3) {
        action = sliptUrl[2];
    } else {
        action = "Index";
    }
    document.getElementById("hdENAction").value = action;
    document.getElementById("hdVNAction").value = action;
    document.getElementById("hdENController").value = controller;
    document.getElementById("hdVNController").value = controller;
</script>
